<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <a href="3">点击前往页面</a>
    <button>前进</button>
    <script>
        //可以前进功能
        history.forward();
        //可以后退功能
        history.back();
        //前进几个页面,或后退几个页面
        history.go(1);
        history.go(-2);
    </script>
</body>
</html>